From: Keir Fraser Date: Mon, 9 Mar 2009 09:56:16 +0000 (+0000) Subject: Avoid deadlock in tasklet_schedule() after console_force_unlock(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13994^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=100f5738dcf45d4ca2ec7224e728b16690ac52a8;p=xen.git Avoid deadlock in tasklet_schedule() after console_force_unlock(). Signed-off-by: Keir Fraser --- diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 00a32022dd..f6ce51aad8 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -420,6 +420,8 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer) * ***************************************************** */ +static bool_t console_locks_busted; + static void __putstr(const char *str) { int c; @@ -429,10 +431,12 @@ static void __putstr(const char *str) sercon_puts(str); vga_puts(str); - while ( (c = *str++) != '\0' ) - putchar_console_ring(c); - - tasklet_schedule(¬ify_dom0_con_ring_tasklet); + if ( !console_locks_busted ) + { + while ( (c = *str++) != '\0' ) + putchar_console_ring(c); + tasklet_schedule(¬ify_dom0_con_ring_tasklet); + } } static int printk_prefix_check(char *p, char **pp) @@ -665,6 +669,7 @@ void console_force_unlock(void) { spin_lock_init(&console_lock); serial_force_unlock(sercon_handle); + console_locks_busted = 1; console_start_sync(); }